﻿using System;
using Ficharts.Net.Examples.Code;

namespace Ficharts.Net.Examples.Examples.Stacked
{
    public partial class StackedColumn : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Chart.ChartTitle.Title = "产品销量状况";
                Chart.YAxises.Add(new LinearAxis() { Title = "产量" });
                Chart.XAxises.Add(new FieldAxis { Title = "年份" });

                var stackedColumn = new Net.StackedColumn();
                stackedColumn.Stacks.Add(new Stack() { XField = "Label", YField = "ValueA" });
                stackedColumn.Stacks.Add(new Stack(){XField = "Label",YField = "ValueB"});
                Chart.Series.Add(stackedColumn);
                Chart.Legend.Enable = true;
                Chart.DataSource = ExampleData.DemoData4();
                Chart.DataBind();
            }
        }
    }
}